﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Jemgine.MapEditor
{
	public partial class GridProperties : Form
	{
		GridSettings _settings;

		internal GridProperties(GridSettings _settings)
		{
			InitializeComponent();
			this._settings = _settings;
		}

		private void createButton_Click(object sender, EventArgs e)
		{
			try
			{
				_settings.Width = Convert.ToInt32(widthBox.Text);
				_settings.Height = Convert.ToInt32(heightBox.Text);
				_settings.Cancelled = false;
				this.Close();
			}
			catch (Exception)
			{ }
		}

		private void cancelButton_Click(object sender, EventArgs e)
		{
			_settings.Cancelled = true;
			this.Close();
		}
		
	}
}
